# coding=utf-8

import json
import sys

if __name__ == '__main__':
    n = int(sys.argv[1])
    graph = {str(i): {str(i - 1): 1, str(i + 1): 1} for i in xrange(1, n)}
    graph.update({"0": {"1": 1}})
    graph.update({str(n): {str(n - 1): 1}})
    print json.dumps(graph)
